<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>智慧农业大数据</title>
    <script src="/static/home/js/jquery-3.4.1.min.js" type="text/javascript"></script>
    <style>
        #one{
            height: 150px;
            margin: 0;
            padding: 0;
        }
        #theme{
            font-size: 45px;
            color: #125d18cc;
            text-align:center;
            letter-spacing: 5px;
            font-weight: 600;
        }
        #image{
            position: fixed;
            top: 0;
            left: 0;
            z-index: 2;
        }
        .scroll {
            height: 40px;
            width: 40%;
            margin: 18px auto 0px auto;
        }
        .scroll span{
            font-size: 25px;
            letter-spacing: 3px
        }
        #linkweb{
            float: right;
        }
        ul{
            margin: 0 !important;
            padding:0 !important;
        }
        ul li{
            list-style: none;
            height: 150px;
            line-height: 150px;
            /*border: 2px dashed #125d18cc;*/
            border: 2px solid #125d18cc;
            margin-top: 5px;
            background-color: #125d18cc;
            text-align: center;
            font-size: 30px;
            font-weight: bold;
            font-family: 'Comic Sans MS', cursive, sans-serif
        }
        .tab .tab-menu{
            width: 15%;
            height: 400px;
            float: left;
            margin: 0;
            padding: 0;
        }
        .tab .tab-iframes{
            width: 80%;
            float: left;
            margin-left: 3%;
        }
        .change{
            background-color: #125d18cc;
        }
        .point li{ cursor: pointer}
    </style>
</head>
<body >
<div id = "one">
    <div id="theme">智慧农业大数据</div>
    <div class="scroll">
        <marquee  align="left" direction="left" behavior="scroll"  loop=-1 height=40 width=100% hspace=0 scrollamount=10
                  scrolldelay=1 vspace=0><font color="#CF2728"><span>欢迎各位领导专家莅临指导</span></font></marquee>
    </div>
    <span id="linkweb" style="font-size: 16px"></span>
    <script>setInterval("linkweb.innerHTML=new Date().toLocaleString();",1000);</script>
</div>

<div id="image">
    <img src="/static/home/images/water_1.jpg" style="width: 300px;height: 150px">
</div>

<hr/>

<div class="tab">
    <div class="tab-menu">
        <ul class="point">
            <li class="change"> 设备控制 </li>
            <li id="li2" > 历史数据 </li>
            <li> 实时数据 </li>
            <li> 数据接收 </li>
            <!-- <li ><a href="http://49.122.47.235">摄像头</a>  </li> -->
            <li ><a href="{:url('showData')}" target="_blank">摄像头</a>  </li>
        </ul>
    </div>
    <div class="tab-iframes">
        <iframe id="iframe1" style="width: 100%" src="{:url('control')}" scrolling="no"
                frameborder="0" onload="this.height=this.contentWindow.document.documentElement.scrollHeight"></iframe>
        <!--<iframe  style="width: 100%;" id="iframe2" scrolling="no" frameborder="0"  name="iframes" onload="this.height=this.contentWindow.document.documentElement.scrollHeight;"></iframe>-->
        <!--<iframe id="iframe2" src="{:url('history')}" scrolling="no" frameborder="0" onload="this.height=this.contentWindow.document.documentElement.scrollHeight;this.style.display='none'"-->
                <!--style="width:  100%;" ></iframe>-->
        <!--<iframe id="iframe3" src="{:url('control')}" scrolling="no" frameborder="0" onload="this.height=this.contentWindow.document.documentElement.scrollHeight;this.style.display='none'"-->
                <!--style="width:  100%;"></iframe>-->
    </div>
    <div style="clear: both"></div>
</div>
</body>
</html>
<script>
    $("ul li").click(function(){
        //通过 .index()方法获取元素下标，从0开始，赋值给某个变量
        var _index = $(this).index();
        if(_index == 0){
            $("#iframe1").attr('src',"{:url('control')}");
        }
        if(_index == 1){
            $("#iframe1").attr('src',"{:url('history')}");
        }
        if(_index == 2){
            $("#iframe1").attr('src',"{:url('real_time')}");
        }
        if(_index == 3){
            $("#iframe1").attr('src',"{:url('data')}");
        }
        //改变选中时候的选项框的样式，移除其他几个选项的样式
        $(this).addClass("change").siblings().removeClass("change");
    });


</script>